package com.hjh.pro.annotation1.controller;

import com.hjh.pro.annotation1.annotation.aspect.ConverterField;
import com.hjh.pro.annotation1.config.Bean1;
import com.hjh.pro.annotation1.config.InitProperties;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/demo")
public class DemonController {


    @Autowired
    private InitProperties properties;

    @RequestMapping
    public String demo(){
        return "demo";
    }


    @RequestMapping("/aspect1")
    @ConverterField
    public String aspect1(){
        return "aspect1";
    }


    @RequestMapping("/test1")
    public String test1(){
        return "test1:"+properties.getUser();
    }

    @RequestMapping("/test2")
    public String test2(){
        for (Bean1 bean1 : properties.getList()) {
            System.out.println("======>> "+bean1.getUser());
            
        }

        return "test1:"+properties.getUser();
    }



}
